<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<form id="form_cert_continue" class="panel-body form-horizontal form-padding">
    <input type="hidden" name="keyId" id="keyId" value="${keyId}"/>
    <div class="form-group">
        <label class="col-md-2 control-label">评定日期<i class="fa fa-asterisk txt-color-red"></i></label>
        <div class="col-md-6">
            <div class="input-group date">
                <input type="text" class="form-control" id="datEvaluate" name="datEvaluate" placeholder="请选择新的评定日期" >
                <span class="input-group-addon"><i class="ti-calendar"></i></span>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="col-md-2 control-label">有效期限<i class="fa fa-asterisk txt-color-red"></i></label>
        <div class="col-md-6">
            <div class="input-group date">
                <input type="text" class="form-control" id="datValid" name="datValid" placeholder="请选择新的有效期限" >
                <span class="input-group-addon"><i class="ti-calendar"></i></span>
            </div>
        </div>
    </div>
</form>

<script>

    // 日期选择
    $('.input-group.date').datepicker({
        format: 'yyyy-mm-dd',
        weekStart: 1,
        autoclose: true,
        todayBtn: 'linked',
        todayHighlight: true,
        language: 'zh-CN'
    });

    function fn_cert_continue_save(callback) {
        var tmp = $("input#datEvaluate").val();
        if(!tmp){
            __toastr_error("请选择新的评定日期！");
            return false;
        }
        tmp = $("input#datValid").val();
        if(!tmp){
            __toastr_error("请选择新的有效期限！");
            return false;
        }
        __form_save('form_cert_continue', '<%=path%>/activiti/cert/savecontinue/'+$("#keyId").val(),
            function(data){
                if(data.state == 1){
                    callback(data.data);
                } else {
                    callback();
                }
            }, function () {
                callback();
            });
    }

</script>
